﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Windvoice.Library;

namespace Windvoice.Blog.Services.DataContract.Traslator
{
    public static class ArticleTranslator
    {
        public static ArticleDataContract Translat(Article article)
        {
            if (article == null)
                return null;
            return new ArticleDataContract()
            {
                Author = article.Author,
                CategoryID = article.CategoryID,
                Content = HtmlHelper.HtmlSummary(article.Content, 100),
                CreateTime = article.CreateTime,
                Hits = article.Hits,
                ID = article.ID,
                Title = article.Title,
                UniqueKey = article.UniqueKey,
                Weather = article.Weather
            };
        }
    }
}
